/**
 * Created by wenchuan.li 2018/5/9.
 */
define(function () {

    var self,
        app = win.app,
        user,
        items = []
    ;

    var Index = app.Module.extend({

        init: function () {
            self = this;
            self._super({}, win);
            self.getTypes();
        },
        getTypes: function () {
            app.ajax({
                xurl: "api/wx/gwat100/getGwahData",
                xtime: '1d',
                xdata: {},
                cb: function (result) {
                    if (result.ok) {
                        var datas = result.data.data;
                        items.pushArray(datas);
                    }
                }
            });
        },
        _lazy: function () {

        },
        _ready: function () {
            new Vue({
                el: app.getByid(doc, 'content'),
                data: {
                    items: items
                },
                methods: {
                    openWindow: function (code) {
                        var args = {};
                        switch (code) {
                            case 'flll':
                                args.src = "gwcxd/classes.html";
                                break;
                            case 'gwc':
                                args.src = "gwcxd/gwc.html";
                                args.argsKey = 'classes_page';
                                break;
                            case 'qzsj':
                                args.src = "gwcxd/qzsj.html";
                                break;
                        }
                        app.openPage(args);
                    }
                }
            });
        }
    });

    new Index();

});